package cn.csust.net2.manager.shared.po;

import java.io.Serializable;
import java.util.Date;

import cn.csust.net2.manager.shared.vo.TreeLeaf;
import cn.csust.net2.manager.shared.xml.XmlInfo;
import cn.csust.net2.manager.shared.xml.XmlResources;

import com.extjs.gxt.ui.client.data.BeanModelTag;

/**
 * 1.实现序列化接口并添加序列化ID可以使bean被GWT传输
 * 实现BeanModelTag接口可以使GXT在reader时候创建bean工厂
 * 2.@DisplayField(value = "姓名")表明在使用组件的时候列的名称
 * 	@DisplayField(value = "姓名")表明在该类被当做级联表时候，以此值作为显示的内容
 * %%%%%%%%%%属性定义顺序就为显示的顺序%%%%%%%%%%
 * 
 * 在GWT中无法使用JAVA反射的API
 * 
 * 
 * 
 * @author Administrator 
 *
 */

public class Student extends User implements Serializable,BeanModelTag ,TreeLeaf{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private long studentNumber;
	private Date entryDate;
	private String dormitory;
	private Banji banji;
	private int register;

	public Banji getBanji() {
		return banji;
	}

	public void setBanji(Banji banji) {
		this.banji = banji;
	}

	public long getStudentNumber() {
		return studentNumber;
	}

	public void setStudentNumber(long studentNumber) {
		this.studentNumber = studentNumber;
	}

	public Date getEntryDate() {
		return entryDate;
	}

	public void setEntryDate(Date entryDate) {
		this.entryDate = entryDate;
	}

	public String getDormitory() {
		return dormitory;
	}

	public void setDormitory(String dormitory) {
		this.dormitory = dormitory;
	}
	
	@SuppressWarnings("rawtypes")
	@Override
	public Class getSelf() {
		// TODO Auto-generated method stub
		return Student.class;
	}

	@SuppressWarnings("rawtypes")
	@Override
	public Class [] getChildren() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getNodeId() {
		// TODO Auto-generated method stub
		return String.valueOf(this.getUserID());
	}

	@Override
	public String getNodeName() {
		// TODO Auto-generated method stub
		return this.getName();
	}

	@Override
	public XmlInfo getXmlInfo(XmlResources instance) {
		// TODO Auto-generated method stub
		XmlInfo xmlInfo = new XmlInfo();
		xmlInfo.setTextResource(instance.student());
		xmlInfo.setSubclass("Student");
		return xmlInfo;
	}

	@Override
	public String getDisplayName() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getNodeIdName() {
		// TODO Auto-generated method stub
		return "userID";
	}

	public int getRegister() {
		return register;
	}

	public void setRegister(int register) {
		this.register = register;
	}


}
